<?php
use_helper('Text');

$tab_events = "";
if($eventsList->count() > 0) {
    $tab_events .= "<ul id='seeOtherNews' class='other-news'>";
    foreach($eventsList as $event) {
        if($event['id'] != $idCurrentEvent) {
            $imagesAttributes = Utils::getImageSize($event['sfAsset'][ 'Folder' ][ 'relative_path' ], $event['sfAsset'], 63, 36 );
            $tab_events .=
                '<li>
                    <h3><a href=' . url_for(array('module' => 'event', 'action' => 'index', 'year' => date("Y", strtotime($event['updated_at'])), 'month' => date("m", strtotime($event['updated_at'])), 'title_slug' => $event['slug']))  .' >
                        ' . truncate_text($event['title'], 30, '...') .'
                    </a></h3>
                    <span>Posté le ' . date("d/m/Y", strtotime($event['updated_at'])) . '<br/>par ' . $event['sfGuardUser01']['username'] . '<span class="nb-com">' . $event['nb_comments'] . '</span></span>
                    <div class="thumb">'
                        . (!is_null($imagesAttributes) ? '<img title="' . $event['title'] . '" alt="' . $event['title'] . '" src="' . $imagesAttributes['small']['url'] . '" width="' . $imagesAttributes['small']['width'] . '" height="' . $imagesAttributes['small']['height'] . '"/>' : "") . '
                    </div>
                 </li>';
        }
    }
    $tab_events .= "</ul>";
}

if(!empty($tab_events)){ ?>
    <div class="see_too">
        <?php
        include_partial('genericComponent/rightTitle', array('title' => 'Voir aussi'));
        echo $tab_events;
        ?>
        <div class="push_float_left"></div>
    </div>
    <?php
}

?>